package com.vhly.ddxdecompiler.dexreader.file.constant;

import com.vhly.ddxdecompiler.dexreader.file.DexFile;
import com.vhly.ddxdecompiler.dexreader.file.TypeIdsSection;
import com.vhly.ddxdecompiler.dexreader.file.mixeditem.TypeIdItem;

/**
 * Created by IntelliJ IDEA.
 * User: vhly[FR]
 * Date: 2009-10-21
 * Time: 22:08:00
 * Platform: Mac OS X 10.5.8
 *
 * @author vhly[FR]
 */
public class CstType implements CstConstant{
    private int typeIndex;

    private TypeIdItem type;

    public CstType(int index) {
        typeIndex = index;
    }

    public void reloc(DexFile dex) {
        TypeIdsSection types = dex.getTypeIds();
        type = types.indexOf(typeIndex);
    }

    public Object getJavaData() {
        return type.getItem().toString();
    }

    public String getJavaType() {
        return null;
    }
}
